package com.ybu.oodd.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private int code;
    private String message;
    private Object data;

    public static Result success(String message){
        Result result = new Result();
        result.code = 1;
        result.message = message;
        return result;
    }

    public static Result success(String message, Object data){
        Result result = Result.success(message);
        result.data = data;
        return result;
    }

    public static Result error(String message){
        Result result = new Result();
        result.code = 0;
        result.message = message;
        return result;
    }
}